import {
  clearHistory
} from "../../request/api"
Component({
  properties: {
    historyarr: {
      type: Array
    },
    hotarr: {
      type: Array
    },
  },
  methods: {
    clear() {
      clearHistory().then(res => {
        // console.log(res);
        if (res.errno == 0) {
          wx.showToast({
            title: '删除成功',
            icon: "success",
            duration: 2000
          })
          this.triggerEvent("refresh")
        }
      })
    },
    goSearch(e) {
      this.triggerEvent("goSearchFn", e.currentTarget.dataset.item)
    }
  }
})